﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MsgReplyPage.aspx.cs" Inherits="ZX.WebApp.EHR.MsgReplyPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
     html, body { margin: 0; padding: 0; background-color:#F2F8FF; }
 ul, li ,dl, dt, dd{ margin:0; padding:0; list-style:none;}
        #Container{width:100%; position:relative; margin: 0 auto;font-family: Arial,Helvetica,sans-serif; font-size: 13px; overflow-x:hidden; }
        #left{width:100%; min-height:515px; }
            #left table{ border-collapse:collapse; width:100%;}
            #left table tr{}
            #left table tr td, #left table tr th{ border:1px solid #d4dbe2}
            #left table tr td{ height:30px; line-height:30px; color:; padding:2px;}
                #left table tr td textarea{ width:98%; background-color:#EAF2FC; color:#2260A3; }
                #left table tr td input.submit{
                    padding:5px 10px; background-color:#5D99DA; color:White; border:#ccc solid 1px; cursor:pointer;
                }
            #left table tr th{font-weight:100; width:108px; text-align:right; vertical-align:middle;}


        #right{ position:absolute; top:0; right:0; width:50%;}
            #right dl{ margin-left:35px;  border:#5D99DA solid 1px; background-color:#FFF; height:100%; overflow:auto; padding:10px 5px;}
            #right dl dt{ background-color:#5D99DA; color:White;}
            #right dl dd{ padding:3px 0; border-bottom:#ccc dashed 1px; }
            
            #right dl dd span input.btn{padding:5px 10px; background-color:#5D99DA; color:White; border:#226AB7 solid 1px; cursor:pointer;}
        
        #right .wgBase{height:100%; position:fixed;}
            #right .wgBase .wgDefault{ position:absolute; width:35px;  height:120px; background-color:#5D99DA; color:White; cursor:pointer; }
            #right .wgBase .wgDefault span{ display:inline-block; width:20px; 
                                            height:100%; font-size:14px; font-weight:bold;
                                            margin:6px 0 0 10px}
            
        
        /*部门*/
        .deptBase{ background-color:#C6EDF4; border:#54B7C9 solid 1px; margin-bottom:5px;}
            .deptBase ul{}
            .deptBase ul li{display:inline-block; height:25px; line-height:25px; float:left;}
    </style>
    <script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <%--
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>--%>
    <script type="text/javascript" src="../Scripts/Public.js"></script>
    <script type="text/javascript" src="../Scripts/CombinButton.js"></script>
    <script src="../Scripts/yui.list.common.js" type="text/javascript"></script>
    <script type="text/javascript">
        var isLoadAll = false;
        var instanceShow = null;
        var showModel = function (refParams) {
            this.mainDom = refParams.mainDom || "";
            this.isShow = refParams.isShow || false;

            this.rightWidth = refParams.rightWidth || 0;
            //偏移数
            this.chageVal = refParams.chageVal || 35;

            this.init = function () {
                var that = this;
                $("#" + instanceShow.mainDom)[0].style.right = (that.rightWidth - that.rightWidth * 2) + that.chageVal + "px";
                $("#" + instanceShow.mainDom)[0].style.height = ($("#left").height() - 50) + "px";
            }

            this.showMainFunction = function () {
                var that = this;
                var a = $("#" + that.mainDom)[0].style.right.replace("px", "");
                a = (a != "") ? a : 0;

                if (a == 0) {
                    $("#" + that.mainDom).animate({ right: (that.rightWidth - that.rightWidth * 2) + that.chageVal }, 100);
                } else {
                    $("#" + that.mainDom).animate({ right: 0 }, 100);
                }
            }
            return this;
        }

        $(function () {
            init();
            isLoadAll = true;
        });

        function init() {
            instanceShow = new showModel({
                mainDom: "right",
                rightWidth: $("#right").width(),
                chageVal: 30
            });

            instanceShow.init();

            var b = '<%=IsReplyBlock %>';
            if (b == "False") $(".wgDefault").hide();

        }

        function showAnimate(sender) {
            var a;
            1 == (typeof (instanceShow) != "null") ? a = true : a = false;
            if (a) {
                instanceShow.showMainFunction();
            }
        }

        function CallBackError(msg) {
            var timeSpanShow = setTimeout(function () {
                alert(msg);
            }, 1);
            return false;
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Container">
        <div id="left">
            <table>
                <tr>
                    <th>
                        申请人：
                    </th>
                    <td>
                        <asp:Literal ID="ltCreatePeopleName" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>
                        建议部门：
                    </th>
                    <td style="color: Blue; font-size: 14px;">
                        <asp:Literal ID="ltDepartment" runat="server"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <th>
                        反馈标题：
                    </th>
                    <td>
                        <asp:Literal ID="ltTitle" runat="server"></asp:Literal>
                    </td>
                </tr>
                <%if (!this.IsEditBlock)
                  {%>
                <tr>
                    <th>
                        反馈内容：
                    </th>
                    <td>
                        <div style="height: 30px; display: none; line-height: 30px; position: relative; background-color: #E0ECFF;">
                            <span style="position: absolute; left: 0; top: 5px;">
                                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
                                    AppendDataBoundItems="True">
                                    <asp:ListItem Value="">请选择历史版本</asp:ListItem>
                                </asp:DropDownList>
                            </span>
                        </div>
                        <asp:Literal ID="ltContent" runat="server"></asp:Literal>
                        <%if (!this.PState)
                          { %>
                        <div style="display: none;">
                            <asp:Button ID="btnEdit" runat="server" Text="编辑内容" OnClick="btnEdit_Click" /></div>
                        <%} %>
                    </td>
                </tr>
                <%} %>
                <%if (this.IsEditBlock)
                  { %>
                <tr style="display: none;">
                    <th>
                        编辑内容：
                    </th>
                    <td>
                        <asp:TextBox ID="tbEditContent" runat="server" Rows="15" TextMode="MultiLine"></asp:TextBox>
                        <div style="background-color: #E0ECFF;">
                            <asp:Button ID="Button2" runat="server" Text="保存编辑内容" CssClass="submit" OnClick="Button2_Click" />
                        </div>
                    </td>
                </tr>
                <%} %>
                <tr style="display: none">
                    <th>
                    </th>
                    <td>
                        <asp:Button ID="btnReply" runat="server" Text="回复内容" OnClick="btnReply_Click" />
                    </td>
                </tr>
                <tr>
                    <th>
                        部门回复：
                    </th>
                    <td>
                        <%if (!this.PState)
                          { %>
                        <div style="background-color: #E0ECFF; color: #0075FF; margin-bottom: 5px; border: #82ADED solid 1px;">
                            <asp:CheckBox ID="cbIsLDHF" runat="server" Text="陈董批复" />(勾选之后的回复数据为陈董批复)</div>
                        <div class="deptBase">
                            <ul>
                                <asp:Repeater ID="DepamentList" runat="server">
                                    <ItemTemplate>
                                        <li>
                                            <asp:CheckBox ID="cbRule" runat="server" />
                                            <asp:Literal ID="Literal1" runat="server" Visible="false" Text='<%#Eval("DeptID") %>'></asp:Literal>
                                            <span>
                                                <%#Eval("DeptName")%></span>
                                            <asp:Literal ID="hide2" runat="server" Visible="false" Text='<%#Eval("DeptName") %>'></asp:Literal>
                                        </li>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                            <div style="clear: both; color: #0075FF;">
                                选择相应部门管理人员回复(可选)</div>
                        </div>
                        <asp:TextBox ID="tbContent" runat="server" TextMode="MultiLine" Rows="6"></asp:TextBox>
                        <asp:Button ID="btnSubmit" runat="server" Text="提交回复" CssClass="submit" OnClick="btnSubmit_Click" />
                        <%}
                          else
                          {%>
                        <asp:Repeater ID="Repeater2" runat="server" OnItemCommand="Repeater1_ItemCommand">
                            <ItemTemplate>
                                <dd>
                                    <div style="position: relative;">
                                        <div style="color: #999; padding: 5px 0; background-color: #F2F8FF;">
                                            回复时间：<%#Eval("ReplyTime")%>
                                            <%#(Eval("ChangeType").ToString() == "1") ? " <span style=' color:Blue'>[陈董批复]</span>" : ""%></div>
                                        <%#(!string.IsNullOrEmpty(Eval("DeptDescription").ToString())) ? "<div style=\" background:#C6EDF4;\">部门回复：" + Eval("DeptDescription") + "</div>" : ""%>
                                        <div style="background-color: #E0ECFF; padding: 5px 2px;">
                                            <%#Eval("Content").ToString().Replace("\r\n","<Br>")%></div>
                                    </div>
                                </dd>
                            </ItemTemplate>
                        </asp:Repeater>
                        <%} %>
                    </td>
                </tr>
            </table>
        </div>
        <div id="right">
            <div class="wgBase">
                <div class="wgDefault" onclick="showAnimate(this)">
                    <span>查看回复记录</span>
                </div>
            </div>
            <dl>
                <dt style="display: none">历史回复记录:</dt>
                <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
                    <ItemTemplate>
                        <dd>
                            <div style="position: relative;">
                                <div style="color: #999; padding: 5px 0; background-color: #F2F8FF;">
                                    回复时间：<%#Eval("ReplyTime")%>
                                    <%#(Eval("ChangeType").ToString() == "1") ? " <span style=' color:Blue'>[陈董批复]</span>" : ""%></div>
                                <%#(!string.IsNullOrEmpty(Eval("DeptDescription").ToString())) ? "<div style=\" background:#C6EDF4;\">部门回复：" + Eval("DeptDescription") + "</div>" : ""%>
                                <div style="background-color: #E0ECFF; padding: 5px 2px;">
                                    <%#Eval("Content").ToString().Replace("\r\n","<Br>")%></div>
                                <%if (!this.PState)
                                  { %>
                                <span style="position: absolute; bottom: 0; right: 0;">
                                    <asp:Button ID="Button1" CssClass="btn" runat="server" Text="删除" CommandArgument='<%#Eval("ID")%>'
                                        CommandName="del" /></span>
                                <%} %>
                            </div>
                        </dd>
                    </ItemTemplate>
                </asp:Repeater>
            </dl>
        </div>
        <div style="clear: both;">
        </div>
    </div>
    </form>
</body>
</html>
